<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\web\View;
use yii\widgets\LinkPager;
use yii\base\Widget;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$search='';
if(isset($get['GoodsSearch']['name']) && $parent==null){
    if($get['GoodsSearch']['name']==''){
        $this->title = '所有商品-搜索锐锋堂刀剑网';
    }else{
        $search='?search='.$get['GoodsSearch']['name'];
        $this->title = $get['GoodsSearch']['name'].'-搜索锐锋堂刀剑网';
    }
    
}else{
    if($get['pid']==$parent){

        $this->title = $cdata[$parent]['name'].'-锐锋堂刀剑网';
    }else{
        $this->title = $cdata[$get['pid']]['name'].'-'.$cdata[$parent]['name'].'-锐锋堂刀剑网';
    }
}

$this->params['breadcrumbs'][] = $this->title;
$this->registerCssFile('/css/common.css');
$this->registerCssFile('/fonts/iconfont.css');
$this->registerCssFile('/css/goodslist.css');
$this->registerJsFile('/js/jquery.reveal.js', [
    'position' => View::POS_BEGIN
]);
$this->registerJsFile('/js/jquery.SuperSlide.2.1.1.js', [
    'position' => View::POS_BEGIN
]);
$this->registerCss('a.active{color: #fff;background: #FF6060;}');
$this->registerJsFile('/js/footer.js');
$this->registerJsFile('/js/common_js.js');
$this->registerJsFile('/js/lrtk.js');
$this->registerJsFile('/layer/layer.js');
$this->registerJsFile('/js/public.js');
$this->registerJs('
    jQuery(".page_recommend").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",autoPlay:true,vis:4,trigger:"click"});
    jQuery("#tabRank li").hover(function(){ jQuery(this).addClass("on").siblings().removeClass("on")},function(){ });
    jQuery("#tabRank").slide({ titCell:"dt h3",autoPlay:false,effect:"left",delayTime:300 });
   
    ');
$this->registerJsFile('/js/jquery.lazyload.min.js', [
    'position' => View::POS_END
]);
$this->registerJs('$(function() {
      jQuery("img.lazy").lazyload({effect: "fadeIn",threshold :70});
  });');
$params = Yii::$app->view->params;
?>

<!--产品列表样式-->
<div class="Inside_pages clearfix">
	<!--筛选样式-->
	<div id="Filter_style">
		<!--推荐-->
		<div class="page_recommend">
			<div class="hd">
				<em></em>今日推荐
				<ul></ul>
			</div>
			<div class="bd">
				<ul>
				<?php if(!empty($hot)):?>
				<?php foreach ($hot as $val):?>
					<li>
						<div class="img">
							<a href="/goods/view-<?=$val['id']?>.html" target="_blank"><img src="<?=$val['logo']?>" width="170" height="120" /></a>
						</div>
						<div class="pro_info">
							<a href="/goods/view-<?=$val['id']?>.html" target="_blank"><?=$val['name']?></a>
							<p class="Price">
								<i>￥</i><?=$val['price']?>
							</p>
							<p class="Sales">
								已有：<b><?=$val['look']?></b>人关注
							</p>
						</div>
					</li>
				<?php endforeach;?>
				<?php endif;?>
				</ul>
			</div>
			<a class="next" href="javascript:void(0)"><em
				class="iconfont icon-left"></em></a> <a class="prev"
				href="javascript:void(0)"><em class="iconfont icon-right"></em></a>
		</div>
		<!--条件筛选样式-->
		<div class="Filter">
			<div class="Filter_list clearfix">
				<div class="Filter_title">
					<span>一级分类：</span>
				</div>
				<div class="Filter_Entire">
					<a <?php if($parent==null):?>class='active'<?php endif;?> href="/goods/index.html<?=$search?>">全部</a>
				</div>
				<div class="p_f_name infonav_hidden">
					<p>
					<?php if(isset($params['column'][0])):?>
					<?php foreach($params['column'][0] as $val):?>
						<a <?php if($parent==$val['id']):?>class='active'<?php endif;?> href="/goods/index-<?=$val['id']?>.html<?=$search?>" title="<?=$val['name']?>"><?=$val['name']?></a>
					<?php endforeach;?>
					<?php endif;?>
					</p>

				</div>
				<p class="infonav_more">
					<a href="#" class="more"
						onclick="infonav_more_down(0);return false;">更多<em class="pullup"></em></a>
				</p>
			</div>
			<?php if($parent!=null):?>
			<div class="Filter_list clearfix">
				<div class="Filter_title">
					<span>二级分类：</span>
				</div>
				<div class="Filter_Entire">
					<a <?php if(isset($get['pid']) && $get['pid']==$parent):?>class='active' href="javascript:;"<?php else:?>href="/goods/index-<?=$parent?>.html<?=$search?>"<?php endif;?>>全部</a>
				</div>
				<div class="p_f_name">
				<?php if(isset($params['column'][$parent])):?>
					<?php foreach($params['column'][$parent] as $val):?>
					<a <?php if(isset($get['pid']) && $get['pid']==$val['id']):?>class='active'<?php endif;?> href="/goods/index-<?=$val['id']?>.html<?=$search?>"><?=$val['name']?></a>
						<?php endforeach;?>
					<?php endif;?>
				</div>
			</div>
			<?php endif;?>
			<div class="Filter_list clearfix">
				<div class="Filter_title">
					<span>价格：</span>
				</div>
				<div class="p_f_name">
				<?php ActiveForm::begin(['method'=>'get','action'=>false])?>
				<?php if($search!=''):?>
				<input type='hidden' name='GoodsSearch[name]' value='<?=$search?>'/>
				<?php endif;?>
					<input type='text' name='GoodsSearch[price][0]' onkeyup='keynum(this)' value='<?=$get['GoodsSearch'][price][0]>0?max($get['GoodsSearch'][price][0],1):''?>' style='width: 50px;margin:0px 5px 0px 0px'>-<input value='<?=$get['GoodsSearch'][price][1]>0?max($get['GoodsSearch'][price][1],1):''?>' onkeyup='keynum(this)' name='GoodsSearch[price][1]' type='text' style='width: 50px;margin:0px 5px 0px 5px'><input class='active' type='submit'>
				<?php ActiveForm::end()?>
				</div>
			</div>
		</div>
	</div>
	<div class="notice">
	<span>
	宝贝正在陆续上传中,如在本站未找到您所喜欢的宝贝可以联系客服获取,接受各种定制,价格优惠包你满意,绝对正品！
	</span>
	</div>
	<!--样式-->
	<div class="scrollsidebar side_green clearfix" id="scrollsidebar">
		<div class="show_btn" id="rightArrow">
			<span></span>
		</div>
		<!--左侧样式-->
		<!--列表样式属性-->
		<div class="page_right_style">
			<div id="Sorted" style='width: 1200px;'>
				<div class="Sorted">
					<div class="Sorted_style">
						<a href="<?=$search==''?'?':$search.'&'?>#Sorted" <?php if(!isset($get['o']) || $get['o']==0 ||$get['o']>4):?>class="on"<?php endif;?>>综合</a> <a
							href="<?=$search==''?'?':$search.'&'?>o=1#Sorted" <?php if(isset($get['o']) && $get['o']==1):?>class="on"<?php endif;?>>销量</a>
							
    							<?php if(isset($get['o']) && $get['o']==2):?>
    							 <a href="<?=$search==''?'?':$search.'&'?>o=3#Sorted" class="on">价格<i
    							class="iconfont icon-fold"></i></a>
    							<?php elseif (isset($get['o']) && $get['o']==3):?>
    							<a href="<?=$search==''?'?':$search.'&'?>o=2#Sorted" class="on">价格<i
    							class="iconfont icon-unfold"></i></a>
    							<?php else:?>
    							 <a href="<?=$search==''?'?':$search.'&'?>o=2#Sorted">价格<i
    							class="iconfont icon-fold"></i></a>
    							<?php endif;?>
							 <a href="<?=$search==''?'?':$search.'&'?>o=4#Sorted" <?php if(isset($get['o']) && $get['o']==4):?>class="on"<?php endif;?>>新品</a>
					</div>
					<!--产品搜索-->
					<div class="products_search">
						<input name="GoodsSearch[name]"" type="text" class="search_text" value="请输入你要搜索的产品"
							onfocus="this.value=''" onblur="if(!value){value=defaultValue;}"><input
							 type="submit" value="" class="search_btn">
					</div>
					<!--页数-->
					<div class="s_Paging">
						<span> <?=$pages->page+1?>/<?=$pages->pageCount?></span> <a href="<?=isset($pages->links['prev'])?$pages->links['prev']:'javascript:;'?>" class="on">&lt;</a> <a href="<?=isset($pages->links['next'])?$pages->links['next']:'javascript:;'?>">&gt;</a>
					</div>
				</div>
			</div>
			<!--产品列表样式-->
			<div class="p_list  clearfix">
				<ul>
				<?php if(!empty($goods)):?>
				<?php foreach($goods as $val):?>
					<li class="gl-item"><em class="<?php if($val['tag']==1):?>icon_special xinping<?php elseif ($val['tag']==2):?>icon_special tejia<?php elseif($val['tag']==3):?>icon_special renqi<?php endif;?>"></em>
						<div class="Borders">
							<div class="img">
								<a href="/goods/view-<?=$val['id']?>.html" target="_blank"><img class="lazy" data-original="<?=$val['logo']?>"
									style="width: 290px; height: 210px"></a>
							</div>
							<div class="Price">
								<b>¥<?=$val['price']?></b><span>[¥<?=$val['price']?>]</span>
							</div>
							<div class="name">
								<a href="/goods/view-<?=$val['id']?>.html" target="_blank"><?=$val['name']?></a>
							</div>
							<div class="Review">
								已有<a href="#"><?=max($val['look'],0)?></a>人关注过
							</div>
							<div class="p-operate">
								<a href="javascript:;" onclick='collect(<?=$val['id']?>)' class="p-o-btn Collect"><em></em>收藏</a> <a
									href="javascript:;" class="p-o-btn shop_cart"
									onclick="ShowDiv_1('MyDiv1','fade1',<?=$val['id']?>)"><em></em>加入购物车</a>
							</div>
						</div></li>
				<?php endforeach;?>
				<?php endif;?>
				</ul>
				<div>
					<div class="Pagination">
						<?= LinkPager::widget([ 
    'options'=>['class'=>'Paging'],
    'pagination' => $pages, 
	'firstPageLabel' => '首页',
	'lastPageLabel' => '尾页',
    'nextPageLabel' => '下一页', 
    'prevPageLabel' => '上一页',
    'maxButtonCount'=>4
]); ?>
			</div>
					</div>
				</div>
				
		</div>
	</div>
</div>
<!--Begin 弹出层-加入购物车 Begin-->
<div id="fade1" class="black_overlay"></div>
<div id="MyDiv1" class="white_content">
	<div class="white_d">
		<div class="notice_t">
			<span class="fr" style="margin-top: 10px; cursor: pointer;"
				onclick="CloseDiv_1('MyDiv1','fade1')"><img src="/images/close.gif" /></span>
		</div>
		<div class="notice_c">

			<table border="0" align="center" style="margin-top:;" cellspacing="0"
				cellpadding="0">
				<tr valign="top">
					<td width="40"><img src="/images/suc.png" /></td>
					<td><span
						style="color: #3e3e3e; font-size: 18px; font-weight: bold;">宝贝已成功添加到购物车</span><br />
						 购物车共有<span class='cart_total'>1</span>种宝贝 &nbsp; &nbsp;</td>
				</tr>
				<tr height="50" valign="bottom">
					<td>&nbsp;</td>
					<td><a href="/user/cart.html" class="b_sure">去购物车结算</a><a href="javascript:;" onclick="CloseDiv_1('MyDiv1','fade1')" class="b_buy">继续购物</a></td>
				</tr>
			</table>

		</div>
	</div>
</div>
<!--End 弹出层-加入购物车 End-->
